%% 从文本文件中导入数据
% 用于从以下文本文件中导入数据的脚本:
%
%    filename: D:\ScientificResearch\2025-03-27-PVGPU\GPU\data_system.csv
%
% 由 MATLAB 于 2025-04-01 09:34:19 自动生成

%% 设置导入选项并导入数据
clear all;
opts = delimitedTextImportOptions("NumVariables", 9);

% 指定范围和分隔符
opts.DataLines = [2, Inf];
opts.Delimiter = ",";

% 指定列名称和类型
opts.VariableNames = ["Time1", "Pstation", "Qstation", "V1", "V2", "V3", "I1", "I2", "I3"];
opts.VariableTypes = ["double", "double", "double", "double", "double", "double", "double", "double", "double"];

% 指定文件级属性
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";

% 导入数据
tbl = readtable("data_system.csv", opts);

%% 转换为输出类型
Time1 = tbl.Time1;
Pstation = tbl.Pstation;
Qstation = tbl.Qstation;
V1 = tbl.V1;
V2 = tbl.V2;
V3 = tbl.V3;
I1 = tbl.I1;
I2 = tbl.I2;
I3 = tbl.I3;

plot(Time1, Pstation)

%% 清除临时变量
clear opts tbl